<template>
  <div class="tuan">
    <!-- 标题 -->
    <div class="title">
      <h3>爆爆团</h3>
      <p>限时爆款，超级低价</p>
      <div class="qg">
        <span>正在抢购</span>
        <span>上新预告</span>
      </div>
    </div>
    <!-- 商品店铺 -->
    <div class="shop" v-for="(item, index) in tuanList" :key="index">
      <div class="img">
        <img :src="item.picture" alt="" />
      </div>
      <div class="ms">
        <p>{{ item.name }}</p>
        <span>￥{{ item.min_price }}</span>
      </div>
      <div class="qiang">
        <p>马上抢</p>
        <span>{{ item.month_saled_content }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { tuan_list } from "../../utils/api";
export default {
  data() {
    return {
      tuanList: [],
    };
  },
  mounted() {
    tuan_list({ status: 1 }).then((res) => {
      // console.log(res.data);
      this.tuanList = res.data.list;
      console.log(this.tuanList);
    });
  },
};
</script>

<style lang='scss' scoped>
.tuan {
  padding-top: 10px;
  background: orange;
  height: 220px;
  .title {
    h3 {
      text-align: center;
      color: white;
    }
    p {
      text-align: center;
      font-size: 24px;
      line-height: 100px;
    }
    .qg {
      padding: 10px;
      span {
        margin-right: 10px;
        color: white;
        font-size: 20px;
      }
    }
  }
  .shop {
    padding: 10px;
    display: flex;
    background: #f1f1f1;
    width: 96%;
    margin: auto;
    box-sizing: border-box;
    margin-top: 15px;
    border-radius: 5px;
    img {
      width: 100px;
      margin-right: 10px;
      img {
        width: 100%;
      }
    }
    .ms {
      p {
        font-weight: bold;
        margin-bottom: 5px;
      }
    }
    .qiang {
      position: absolute;
      right: 20px;
      p {
        color: white;
        padding: 10px;
        background: red;
        border-radius: 10px;
        margin-bottom: 10px;
      }
    }
  }
}
</style>